/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_grupo_atencion")
@NamedQueries({
    @NamedQuery(name = "CexGrupoAtencion.findAll", query = "SELECT c FROM CexGrupoAtencion c")})
public class CexGrupoAtencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cgr_id")
    private Integer cgrId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "cgr_nombre")
    private String cgrNombre;
    @Column(name = "cgr_codigo")
    private Integer cgrCodigo;
    @Column(name = "cgr_emergencia")
    private Boolean cgrEmergencia;
    @Column(name = "cgr_con_externa")
    private Boolean cgrConExterna;
    @Column(name = "cgr_puntaje")
    private Integer cgrPuntaje;
    @ManyToMany(mappedBy = "cexGrupoAtencionList", fetch = FetchType.LAZY)
    private List<CexConsulta> cexConsultaList;
    @OneToMany(mappedBy = "cexGrupoAtencion", fetch = FetchType.LAZY)
    private List<EmeTriaje> emeTriajeList;

    public CexGrupoAtencion() {
    }

    public CexGrupoAtencion(Integer cgrId) {
        this.cgrId = cgrId;
    }

    public CexGrupoAtencion(Integer cgrId, String cgrNombre) {
        this.cgrId = cgrId;
        this.cgrNombre = cgrNombre;
    }

    public Integer getCgrId() {
        return cgrId;
    }

    public void setCgrId(Integer cgrId) {
        this.cgrId = cgrId;
    }

    public String getCgrNombre() {
        return cgrNombre;
    }

    public void setCgrNombre(String cgrNombre) {
        this.cgrNombre = cgrNombre;
    }

    public Integer getCgrCodigo() {
        return cgrCodigo;
    }

    public void setCgrCodigo(Integer cgrCodigo) {
        this.cgrCodigo = cgrCodigo;
    }

    public Boolean getCgrEmergencia() {
        return cgrEmergencia;
    }

    public void setCgrEmergencia(Boolean cgrEmergencia) {
        this.cgrEmergencia = cgrEmergencia;
    }

    public Boolean getCgrConExterna() {
        return cgrConExterna;
    }

    public void setCgrConExterna(Boolean cgrConExterna) {
        this.cgrConExterna = cgrConExterna;
    }

    public Integer getCgrPuntaje() {
        return cgrPuntaje;
    }

    public void setCgrPuntaje(Integer cgrPuntaje) {
        this.cgrPuntaje = cgrPuntaje;
    }

    public List<CexConsulta> getCexConsultaList() {
        return cexConsultaList;
    }

    public void setCexConsultaList(List<CexConsulta> cexConsultaList) {
        this.cexConsultaList = cexConsultaList;
    }

    public List<EmeTriaje> getEmeTriajeList() {
        return emeTriajeList;
    }

    public void setEmeTriajeList(List<EmeTriaje> emeTriajeList) {
        this.emeTriajeList = emeTriajeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cgrId != null ? cgrId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexGrupoAtencion)) {
            return false;
        }
        CexGrupoAtencion other = (CexGrupoAtencion) object;
        if ((this.cgrId == null && other.cgrId != null) || (this.cgrId != null && !this.cgrId.equals(other.cgrId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexGrupoAtencion[ cgrId=" + cgrId + " ]";
    }
    
}
